<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>DEMO</title>
    <script src="js/loader.min.js"></script>
</head>
<body>
<div id="app"></div>
<script>
    require.config({
        paths:{
            ELEMENT:'https://unpkg.com/element-ui@2.15.6/lib/index',
            VueRouter:'https://unpkg.com/vue-router@3.5.3/dist/vue-router'
        },
       shim:{
           ELEMENT:{
               deps:['https://unpkg.com/element-ui@2.15.6/lib/theme-chalk/index.css']
           }
       }
    })
    require(['vue','ELEMENT','VueRouter','./index'],function(Vue,ElementUI,VueRouter,Index){
        Vue.use(ElementUI)
        Vue.use(VueRouter)

        const routes = [
            { path: '/a', component: (r) => require(['pageA'], r) },//动态路由（需要时才加载），可跟具后台的菜单定制
            { path: '/b', component: (r) => require(['pageB'], r) }
        ]
        const router = new VueRouter({
            routes // short for `routes: routes`
        })
        Index.router=router
        new Vue(Index).$mount("#app")
    })
</script>
</body>
</html>
